/*
 * Copyright (c) 2024 Huawei Technologies Co.,Ltd.
 *
 * openGauss is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 * http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * ---------------------------------------------------------------------------------------
 *
 * vecimcsscan.h
 *
 *
 * IDENTIFICATION
 * src/include/vecexecutor/vecimcsscan.h
 *
 * ---------------------------------------------------------------------------------------
 */
#ifdef ENABLE_HTAP
#ifndef VECIMCSSCAN_H
#define VECIMCSSCAN_H

#include "nodes/execnodes.h"
#include "access/cstoreskey.h"
#include "access/imcs/imcs_am.h"
#include "utils/snapshot.h"


extern IMCSScanState *ExecInitImcsScan(ImcsScan *node, Relation parentHeapRel, EState *estate, int eflags,
    bool indexFlag = false, bool codegenInUplevel = false);
extern VectorBatch *ExecImcsScan(IMCSScanState *node);
extern void ExecEndImcsScan(IMCSScanState *node, bool indexFlag);
extern void ExecReSetRuntimeKeys(IMCSScanState *node);
extern void ExecReScanImcsScan(IMCSScanState *node);
extern void ExecImcsBuildScanKeys(IMCSScanState *state, List *quals, CStoreScanKey *scankeys, int *numScanKeys);

extern void OptimizeProjectionAndFilter(IMCSScanState *node);

extern bool ApplyProjectionAndFillBatch(IMCSScanState *node, VectorBatch *pScanBatch, bool isDeltaBatch);

extern VectorBatch *ApplyProjection(IMCSScanState *node, VectorBatch *pScanBatch, ExprDoneCond *isDone = NULL);

#endif /* VECIMCSSCAN_H */
#endif
